import { API } from './const'
import $http from 'js/request'

// 登录 
export const apiLogin = (userName, password) => {
  return $http.post(`${API}user/PlatformUser/login`, { userName, password })
}

// 找回密码
export const apiFindPwd = (userName, newPassword, mobile, smsCode) => {
  return $http.post(`${API}user/PlatformUser/getPassword`, { userName, newPassword, mobile, smsCode })
}

// 获取/验证 短信验证码
export const apiMsgCode = {
  // 获取
  getMsgCode(mobile) {
    return $http.post(`${API}msgSet/sendMsg`, {mobile})
  },
  // 验证
  valMsgCode (smsCode, mobile) {
    return $http.post(`${API}msgSet/checkSmsCode`, {smsCode, mobile})
  }
}

// 修改密码
export const apiModifyPwd = (params) => {
  return $http.post(`${API}user/PlatformUser/updatePassword`, params)
}

// 获取图片验证码
export const apiGetCode = (data) => {
  return $http.post(`${API}platformIndex/index/code`, data)
}
// 获取菜单--用户对应菜单和三级菜单操作权限
export const apiGetMenuList = (accessToken) => {
  return $http.post(`${API}userAuthority/PlatformUserAuthority/selectUserMenu`, { accessToken })
}

// 获取所有地区--运费模板
export const apiAreaAll = (data) => {
  return $http.post(`${API}transarea/PlatformTransArea/getAreaList`, data)
}

// 获取省市区地区
export const apiArea = (data) => {
  return $http.post(`${API}area/Area/getPageListJson`, data)
}

// 图片上传
export const apiUploadImage = (data) => {
  return $http.post(`${API}goods/Goods/uploadGoodsImageThree`, data)
}

// 获取省市区
export const apiCity = (accessToken) => {
  return $http.post(`${API}area/Area/getPageListJson`, { accessToken })
}

// 视频管理
export const apiVideoMange = {
  // 获取视频列表
  getVideo(params) {
    return $http.post(`${API}video/Video/getVideoList`, params)
  },
  // 视频删除
  delVideo(params) {
    return $http.post(`${API}video/Video/delVideo`, params)
  },
  // 视频详情
  videoInfo(params) {
    return $http.post(`${API}video/Video/getVideoInfo`, params)
  },
  // 视频新增
  addVideo(params) {
    return $http.post(`${API}video/Video/saveVideoInfo`, params)
  },
  // 视频上传
  uploadVideo(params) {
    return $http.post2(`${API}video/Video/uploadVideo`, params)
  }
}

// 商品管理模块
export const apiGoodsMange = {
  // 商品导出--普通，拼单
  apiGoodsExport(params) {
    return $http.get(`${API}goods/Goods/export`, params)
  },
  // 获取普通商品列表 
  apiGetCGoodsLis(params) {
    return $http.post(`${API}goods/Goods/getPageListJson`, params)
  },
  // 商品的上架/下架 
  apiGoodsStore(params) {
    return $http.post(`${API}goods/Goods/goodsGroundUnderCar`, params)
  },
  // 商品的新增与更新、保存草稿箱、预览
  apiGoodsSave(params) {
    return $http.post(`${API}goods/Goods/saveOrUpdate`, params)
  },
  // 商品编辑
  apiGoodsEdit(params) {
    return $http.post(`${API}goods/Goods/get`, params)
  },
  // 商品新增--检查商品货号是否重复
  apiGoodsSerial(goodsSerial) {
    return $http.post(`${API}goods/Goods/goodsSerial`, { goodsSerial })
  },
  // 商品审核操作
  apiGoodsReview(params) {
    return $http.post(`${API}goods/Goods/checkGoods`, params)
  },
  // 商品删除
  apiGoodsDelete(params) {
    return $http.post(`${API}goods/Goods/goodsdelete`, params)
  },
  // 商品生成二维码
  apiGoodsQRcode(ids) {
    return $http.post(`${API}goods/Goods/goodsQRcode`, { ids })
  },
  // 拼单商品--发起拼单--普通在售商品列表
  apiCLaunchGoods(params) {
    return $http.post(`${API}goods/Goods/startPinDan`, params)
  },
  // 拼单商品--列表
  apiLaunchGoods(params) {
    return $http.post(`${API}goods/Goods/getGoodsCrowdFundRules`, params)
  },
  // 拼单商品--详情
  apiLaunchGoodsDetail(params) {
    return $http.post(`${API}goods/Goods/getGoodsGspDetail`, params)
  },
  // 拼单商品--取消审核
  apiLaunchGoodsCancel(accessToken, threeMenuCode, ids) {
    return $http.post(`${API}goods/Goods/cancelCheck`, { accessToken, threeMenuCode, ids })
  },
  // 拼单商品--设置拼单
  apiLaunchGoodsSet(params) {
    return $http.post(`${API}goods/Goods/installCrowdFundRule`, params)
  }
} 

// 分类管理模块--商品新增
export const apiClassifyMange = {
  // 分类--图片上传
  apiUploadImg(params) {
    return $http.post(`${API}classShow/Classshow/classPhotoUpload`, params)
  },
  // 通用分类--查询列表数据
  apiCommonClassify(params) {
    return $http.post(`${API}goodsclass/Goodsclass/getPageListJson`, params)
  },
  // 通用分类--新增，更新
  apiCommonClassifyUpdate(params) {
    return $http.post(`${API}goodsclass/Goodsclass/saveOrUpdate`, params)
  },
  // 通用分类--修改
  apiCommonClassifyEdit(accessToken, threeMenuCode, id) {
    return $http.post(`${API}goodsclass/Goodsclass/get`, { accessToken, threeMenuCode, id })
  },
  // 通用分类--删除
  apiCommonClassifyDelete(accessToken, threeMenuCode, ids) {
    return $http.post(`${API}goodsclass/Goodsclass/del`, { accessToken, threeMenuCode, ids })
  },
  // 展示分类--查询
  apiTypeClassify(params) {
    return $http.post(`${API}classShow/Classshow/getPageListJson`, params)
  },
  // 展示分类--新增、更新
  apiTypeClassifyUpdate(params) {
    return $http.post(`${API}classShow/Classshow/saveOrUpdate`, params)
  },
  // 展示分类--修改
  apiTypeClassifyUpdated(accessToken, threeMenuCode, id) {
    return $http.post(`${API}classShow/Classshow/get`, { accessToken, threeMenuCode, id })
  },
  // 展示分类--删除
  apiTypeClassifyDel(accessToken, threeMenuCode, ids) {
    return $http.post(`${API}classShow/Classshow/del`, { accessToken, threeMenuCode, ids })
  },
  // 类型管理--商品类型查询
  apiGoodsClassify(params) {
    return $http.post(`${API}goods/Goodstype/getPageListJson`, params)
  },
  // 类型管理--商品类型新增/更新
  apiGoodsClassifyAdd(params) {
    return $http.post(`${API}goods/Goodstype/saveOrUpdate`, params)
  },
  // 类型管理--商品类型修改时获取数据
  apiGoodsClassifyUpdate(params) {
    return $http.post(`${API}goods/Goodstype/get`, params)
  },
  // 类型管理--商品类型删除
  apiGoodsClassifyDelete(params) {
    return $http.post(`${API}goods/Goodstype/del`, params)
  },
  // 类型管理--商品规格查询
  apiGoodsSpecs(params) {
    return $http.post(`${API}goods/Goodsspecification/getPageListJson`, params)
  },
  // 类型管理--商品规格新增/更新
  apiGoodsSpecsAdd(params) {
    return $http.post(`${API}goods/Goodsspecification/saveOrUpdate`, params)
  },
  // 类型管理--商品规格修改时查询
  apiGoodsSpecsUpdate(accessToken, threeMenuCode, id) {
    return $http.post(`${API}goods/Goodsspecification/get`, { accessToken, threeMenuCode, id })
  },
  // 类型管理--商品规格删除
  apiGoodsSpecsDel(accessToken, threeMenuCode, ids) {
    return $http.post(`${API}goods/Goodsspecification/del`, { accessToken, threeMenuCode, ids })
  },
  // 商品新增--获取分类列表 
  apiClassifyMenu(accessToken, threeMenuCode, id) {
    return $http.post(`${API}goodsclass/Goodsclass/getGoodsClass`, { accessToken, threeMenuCode, id })
  },
  // 商品新增--获取商品属性
  apiGoodsParams(params) {
    return $http.post(`${API}goods/Goods/getProductParam`, params)
  },
  // 商品新增--获取商品颜色尺码
  getPtysProperty() {
    return $http.post(`${API}goods/Goods/queryProperty`)
  },
  // 商品新增--获取运费模板
  queryGoodsTranSport(id) {
    return $http.post(`${API}transport/PlatfromTransport/queryGoodsTranSport`, { id })
  },
  // 商品新增--获取商家基本信息
  queryShopInfo(params) {
    return $http.post(`${API}goods/Goods/getSellerInfo`, params)
  }
} 

// 店铺管理模块
export const apiShopMange = {
  // 店铺导出
  apiExportShop(params) {
    return $http.get(`${API}store/Store/export`, params)
  },
  // 获取店铺类型
  apiShopType(dictName = '供应商类型') {
    return $http.post(`${API}dict/PlatformDict/getDictName`, { dictName })
  },
  // 获取店铺列表--营业中
  apiShopList(params) {
    return $http.post(`${API}store/Store/getPageListJson`, params)
  },
  // 获取店铺申请列表--待审核/审核不通过
  apiShopReList(params) {
    return $http.post(`${API}businessInfo/BusinessInfo/getPageListJson`, params)
  },
  // 获取店铺基本信息--营业中，新增商品
  apiShopInfo(accessToken, threeMenuCode, id) {
    return $http.post(`${API}store/Store/get`, { accessToken, threeMenuCode, id })
  },
  // 获取店铺基本信息--待审核
  apiShopInfoReview(accessToken, threeMenuCode, id) {
    return $http.post(`${API}businessInfo/BusinessInfo/get`, { accessToken, threeMenuCode, id })
  },
  // 获取店铺经营状态--订单结算
  apiShopStatus(accessToken, threeMenuCode, id) {
    return $http.post(`${API}store/Store/manageStatusForOrderPrice`, { accessToken, threeMenuCode, id })
  },
  // 获取店铺经营状态--各状态商品下的数量
  apiShopStatusGoodsCount(accessToken, threeMenuCode, storeId) {
    return $http.post(`${API}store/Store/storeGoodsInfo`, { accessToken, threeMenuCode, storeId })
  },
  // 获取店铺审核
  apiShopReview(params) {
    return $http.post(`${API}businessInfo/BusinessInfo/checkStoreApply`, params)
  },
  // 删除店铺
  apiShopDelete(accessToken, threeMenuCode, ids, status) {
    return $http.post(`${API}businessInfo/BusinessInfo/updateDeleteStatus`, { accessToken, threeMenuCode, ids, status })
  },
  // 营业中的店铺删除、
  apiShopDel(accessToken, threeMenuCode, ids) {
    return $http.post(`${API}store/Store/del`, { accessToken, threeMenuCode, ids })
  },
  // 营业中的店铺列表
  apiShopName(accessToken) {
    return $http.post(`${API}store/Store/getStoreName`, { accessToken })
  }
} 

// 系统管理模块
export const apiSystemMange = {
  // 获取员工列表 
  getEmployeeLis(params) {
    return $http.post(`${API}user/PlatformUser/selectAdminOrEmployee`, params)
  },
  // 获取角色列表 
  getRoleLis(params) {
    return $http.post(`${API}role/PlatformRole/selectRoleAll`, params)
  },
  // 删除角色
  delRole(params) {
    return $http.post(`${API}role/PlatformRole/del`, params)
  },
  // 新增角色
  addRole(params) {
    return $http.post(`${API}role/PlatformRole/saveOrUpdate`, params)
  },
  // 角色的保存权限
  saveROlePermission(params) {
    return $http.post(`${API}roleAuthority/PlatformRoleAuthority/savePermissionsToRole`, params)
  },
  // 检测用户是否存在
  checkUser(params) {
    return $http.post(`${API}user/PlatformUser/checkUserExist`, params)
  },


  // 获取部门列表 
  getDepartLis(params) {
    return $http.post(`${API}department/PlatformDepartment/getPageListJson`, params)
  },
  // 删除部门
  delDepart(params) {
    return $http.post(`${API}department/PlatformDepartment/del`, params)
  },
  // 新增/修改 部门
  addDepart(params) {
    return $http.post(`${API}department/PlatformDepartment/saveOrUpdate`, params)
  },

  // 获取菜单
  getMenuLis(params) {
    return $http.post(`${API}authority/PlatformAuthority/getMenuAll`, params)
  },
  // 修改菜单
  updateMenu(params) {
    return $http.post(`${API}authority/PlatformAuthority/updateMenu`, params)
  },
  // 新增菜单
  addMenu(params) {
    return $http.post(`${API}authority/PlatformAuthority/addMenu`, params)
  },
  // 删除菜单
  delMenu(params) {
    return $http.post(`${API}authority/PlatformAuthority/del`, params)
  },

  // 查询操作权限
  queryPermission(params) {
    return $http.post(`${API}userAuthority/PlatformUserAuthority/selectApplyPermissions`, params)
  },
  // 员工的保存权限
  savePermission(params) {
    return $http.post(`${API}user/PlatformUser/savePermissions`, params)
  },
  // 查询每个角色对应的基本权限
  queryRolePermission(params) {
    return $http.post(`${API}roleAuthority/PlatformRoleAuthority/getRoleAuth`, params)
  },
  // 新增员工
  addEmploy(params) {
    return $http.post(`${API}user/PlatformUser/addUser`, params)
  },
  // 删除员工
  delEmploy(params) {
    return $http.post(`${API}user/PlatformUser/del`, params)
  },
  // 编辑员工 时，查询员工信息
  getEmployInfo(params) {
    return $http.post(`${API}user/PlatformUser/get`, params)
  },
  // 编辑员工 时，查询员工权限
  editEmploy(params) {
    return $http.post(`${API}userAuthority/PlatformUserAuthority/selectUserMenu`, params)
  },
  // 修改员工
  updateEmploy(params) {
    return $http.post(`${API}user/PlatformUser/updateUser`, params)
  },
  // 员工自己 申请修改角色/部门
  applyRoleDepart(params) {
    return $http.post(`${API}user/PlatformUser/applyPermissions`, params)
  },
  // 员工申请审批 列表
  queryApply(params) {
    return $http.post(`${API}userAuthority/PlatformUserAuthority/selectApplyPermissions`, params)
  },
  // 管理员审核用户
  applyEmploy(params) {
    return $http.post(`${API}userAuthority/PlatformUserAuthority/checkApplyPermissions`, params)
  },
  // 员工申请审批 删除
  delApply(params) {
    return $http.post(`${API}user/PlatformUser/deleteUserApply`, params)
  },
  // 员工申请回复查看
  seeResult(accessToken) {
    return $http.post(`${API}user/PlatformUser/selectApplyReply`, { accessToken })
  },

  // 字典查询 -- 所有
  queryDictionary(params) {
    return $http.post(`${API}dict/PlatformDict/getPageListJson`, params)
  },
  // 字典查询 -- 所有一级字典
  queryParentDict() {
    return $http.post(`${API}dict/PlatformDict/getDictType`)
  },
  // 字典新增/修改
  addDict(params) {
    return $http.post(`${API}dict/PlatformDict/saveOrUpdate`, params)
  },
  // 字典删除
  delDict(params) {
    return $http.post(`${API}dict/PlatformDict/del`, params)
  },

  // 日志查询
  queryLog(params) {
    return $http.post(`${API}/YouzhengSystemLogs/SystemLogs/selectLogs`, params)
  },
  // 日志删除
  delLog(params) {
    return $http.post(`${API}YouzhengSystemLogs/SystemLogs/del`, params)
  },

  // 基本信息 获取
  queryBaseInfo(params) {
    return $http.post(`${API}base/Manage/get`, params)
  },
  // 基本信息 保存
  saveBaseInfo(params) {
    return $http.post(`${API}base/Manage/saveOrUpdate`, params)
  }
}

// app版本上传
export const apiAppMange = {
  // app版本上传文件
  uploadFile(params) {
    return $http.post(`${API}versionmanage/Versionmanage/uploadVersion`, params)
  },
  uploadVersion(params) {
    return $http.post(`${API}versionmanage/Versionmanage/saveOrUpdate`, params)
  }
}

// 会员管理
export const apiMemberMange = {
  // 会员导出
  exportList(params) {
    return $http.get(`${API}receptionUser/User/export`, params)
  },
  // 获取会员列表
  queryMember(params) {
    return $http.post(`${API}receptionUser/User/getPageListJson`, params)
  },
  // 获取会员类型
  queryType(dictName) {
    return $http.post(`${API}dict/PlatformDict/getDictName`, { dictName })
  },
  // 重置密码
  resetPwd(params) {
    return $http.post(`${API}receptionUser/User/updateUserPassword`, params)
  },
  // 禁用/删除 会员
  disableOrDelete(params) {
    return $http.post(`${API}receptionUser/User/update`, params)
  }
}

// 银行卡管理
export const apiBankCardMange = {
  // 查询银行卡列表
  queryBankCard(params) {
    return $http.post(`${API}bank/AdminBank/getBankList`, params)
  },
  // 查询所有可选择的银行 列表
  queryBank(params) {
    return $http.post(`${API}bank/AdminBank/getAllBank`, params)
  },
  // 查询对应银行卡信息
  queryInfo(params) {
    return $http.post(`${API}bank/AdminBank/getBankInfo`, params)
  },
  // 保存 银行卡
  saveBankCard(params) {
    return $http.post(`${API}bank/AdminBank/saveBank`, params)
  },
  // 删除 银行卡
  delBankCard(params) {
    return $http.post(`${API}bank/AdminBank/delBank`, params)
  }
}

// 订单管理模块
export const apiOrderMange = {
  // 各状态订单数量
  apiOrderCount(accessToken, threeMenuCode, storeId) {
    return $http.post(`${API}orderform/YouzhengOrderform/queryOrderNumber`, { accessToken, threeMenuCode, storeId })
  },
  // 普通订单导出功能
  apiOrderExport(params) {
    return $http.get(`${API}orderform/YouzhengOrderform/exportRefundOrder`, params)
  },
  // 获取订单列表: 获取普通订单，拼单主订单列表
  apiOrderListAll(params) {
    return $http.post(`${API}orderform/YouzhengOrderform/getOrderFormList`, params)
  },
  // 拼单列表--子订单列表数据
  apiFOrderList(params) {
    return $http.post(`${API}orderform/YouzhengOrderform/getFightChilds`, params)
  },
  // 拼单列表--主订单详情
  apiFMOrderInfo(accessToken, threeMenuCode, goodsRuleId) {
    return $http.post(`${API}orderform/YouzhengOrderform/mainOrderDetails`, { accessToken, threeMenuCode, goodsRuleId })
  },
  // 拼单列表--主订单详情--设置拼单结果:isAlready: 1,成功，0，失败
  apiFMOrderUpdateStatus(accessToken, threeMenuCode, goodsRuleId, isAlready) {
    return $http.post(`${API}orderform/YouzhengOrderform/updateCollageStatus`, { accessToken, threeMenuCode, goodsRuleId, isAlready })
  },
  // 拼单子订单导出
  apiFOrderExport(params) {
    return $http.get(`${API}orderform/YouzhengOrderform/exportFightChilds`, params)
  },
  // 获取订单详情
  apiCOrderInfo(accessToken, ofId, threeMenuCode) {
    return $http.post(`${API}orderform/YouzhengOrderform/getOrderDetails`, { accessToken, ofId, threeMenuCode })
  },
  // 获取退款订单详情
  apiReOrderInfo(accessToken, ofId, threeMenuCode, reId) {
    return $http.post(`${API}orderform/YouzhengOrderform/getRefundOrderDetails`, { accessToken, ofId, threeMenuCode, reId })
  },
  // 免运费操作
  apiCOrderListFree(accessToken, ofIds, threeMenuCode) {
    return $http.post(`${API}orderform/YouzhengOrderform/freeFreight`, { accessToken, ofIds, threeMenuCode })
  },
  // 改价
  apiChangeGoodsPrice(params) {
    return $http.post(`${API}orderform/YouzhengOrderform/alterOrderFormPrice`, params)
  },
  // 发货
  apiDeliveryGoods(params) {
    return $http.post(`${API}orderform/YouzhengOrderform/delivOrderForm`, params)
  },
  // 修改发货方
  apiEditConsigor(ofId, threeMenuCode, consignor) {
    return $http.post(`${API}orderform/YouzhengOrderform/editConsignor`, { ofId, threeMenuCode, consignor })
  },
  // 延长收货时间，商家备忘，修改订单商品属性, 退款审核
  apiDeliveryGoodsFar(params) {
    return $http.post(`${API}orderform/YouzhengOrderform/updateOrderDetails`, params)
  },
  // 查询订单中商品是否在售
  apiGoodsStatus(ids) {
    return $http.post(`${API}orderform/YouzhengOrderform/checkGoodsSoldOut`, { ids })
  },
  // 查询好下单提醒
  apiRemindMessage(accessToken, ofId, threeMenuCode, type = 1) {
    return $http.post(`${API}orderform/YouzhengOrderform/remindMessage`, { accessToken, ofId, threeMenuCode, type })
  },
  // 查询物流详情
  apiExpressInfo(accessToken, ofId) {
    return $http.post(`${API}express/Express/getExpressInfoByOrderId`, { accessToken, ofId })
  },
  // 获取退款订单列表
  apiRefundOrderList(params) {
    return $http.post(`${API}orderform/YouzhengOrderform/getRefundList`, params)
  },
  // 获取结算订单列表
  apiSettleOrderList(params) {
    return $http.post(`${API}orderform/YouzhengOrderform/getSettleOfList`, params)
  },
  // 获取结算订单详情
  apiBalanceInfo(accessToken, threeMenuCode, ofId) {
    return $http.post(`${API}orderform/YouzhengOrderform/get`, { accessToken, threeMenuCode, ofId })
  },
  // 获取结算详情信息
  apiBalanceDetail(accessToken, threeMenuCode, paymentMark, mulitIds) {
    return $http.post(`${API}orderform/YouzhengOrderform/settlementOfDetail`, { accessToken, threeMenuCode, paymentMark, mulitIds })
  },
  // 结算操作
  apiBalanceSave(accessToken, threeMenuCode, paymentMark, mulitIds) {
    return $http.post(`${API}orderform/YouzhengOrderform/settlementOfSave`, { accessToken, threeMenuCode, paymentMark, mulitIds })
  },
  // 结算订单导出
  apiBalanceExport(params) {
    return $http.get(`${API}orderform/YouzhengOrderform/exportSettlementOrder`, params)
  },
  // 订单查看列表，获取供应链订单
  apiGetOrderList(params) {
    return $http.post(`${API}orderform/getOrderformAll`, params)
  },
  // 获取搜索条件下的商品列表
  apiGoodsList(params) {
    return $http.post(`${API}orderform/getEntryGoods`, params)
  },
  // 订单录入--订单新增
  apiAddOrder(params) {
    return $http.post(`${API}orderform/entryOrderform`, params)
  },
  // 查询录入订单列表
  apiEntryOrder(params) {
    return $http.post(`${API}orderform/getEntryOrderForms`, params)
  },
  // 订单录入列表导出
  apiEntryOrderExport(params) {
    return $http.get(`${API}orderform/exportEntryOrder`, params)
  }
} 

// 运费模板管理
export const apiDeliveryMange = {
  // 获取运费列表
  apiDeliveryList(accessToken, threeMenuCode) {
    return $http.post(`${API}transport/PlatformTransport/getTransport`, { accessToken, threeMenuCode })
  },
  // 新增、修改
  apiDeliverySave(params) {
    return $http.post(`${API}transport/PlatformTransport/saveTransport`, params)
  },
  // 获取详情信息
  apiDeliveryInfo(accessToken, id, threeMenuCode) {
    return $http.post(`${API}transport/PlatformTransport/getTransportById`, { accessToken, id, threeMenuCode })
  },
  // 删除
  apiDeliveryDel(accessToken, idList, threeMenuCode) {
    return $http.post(`${API}transport/PlatformTransport/delTransport`, { accessToken, idList, threeMenuCode })
  },
  // 获取省市区地区
  apiGetAreaAll() {
    return $http.post(`${API}transarea/PlatformTransArea/getAreaList`)
  },
  // 获取省市区地区下级
  apiGetCity(parent_id) {
    return $http.post(`${API}transarea/PlatformTransArea/getCityList`, { parent_id })
  },
  // 获取发货时间
  apiGetDevTime() {
    return $http.post(`${API}transport/PlatformTransport/getSendTime`)
  }
}

// 新闻模板管理
export const apiHotNewMange = {
  // 获取运费列表
  apiHotNewsList(params) {
    return $http.post(`${API}hotspotinfo/Hotspotinfo/getPageListJson`, params)
  },
  // 热点头条--新增，编辑
  apiHotNewsUpdate(params) {
    return $http.post(`${API}hotspotinfo/Hotspotinfo/saveOrUpdate`, params)
  },
  // 热点头条--查看详情
  apiHotNewsInfo(accessToken, id) {
    return $http.post(`${API}hotspotinfo/Hotspotinfo/getHotsOrTopInfo`, { accessToken, id })
  },
  // 热点头条--图片上传
  apiHotNewsUpload(params) {
    return $http.post(`${API}classShow/Classshow/classPhotoUpload`, params)
  },
  // 删除
  apiHotTypeDel(accessToken, idList, threeMenuCode) {
    return $http.post(`${API}hotspotinfo/Hotspotinfo/del`, { accessToken, idList, threeMenuCode })
  }
}

// 装修管理
export const apiDecorateMange = {
  // 图片上传
  uploadImg(params) {
    return $http.post(`${API}advert/Advert/uploadPicture`, params)
  },
  // 获取 所有 导航列表
  getNavList(params) {
    return $http.post(`${API}navigation/Navigation/getNavigationList`, params)
  },
  // 删除导航
  delNav(params) {
    return $http.post(`${API}navigation/Navigation/delNavigationById`, params)
  },
  // 新增/编辑导航
  addNav(params) {
    return $http.post(`${API}navigation/Navigation/saveNavigation`, params)
  },
  // 获取导航信息
  getNavInfo(params) {
    return $http.post(`${API}navigation/Navigation/getNavigationById`, params)
  },

  // 获取频道列表
  getChannelList(params) {
    return $http.post(`${API}channel/Channel/getChannelList`, params)
  },
  // 新增/编辑 频道
  addChannel(params) {
    return $http.post(`${API}channel/Channel/saveChannel`, params)
    // return $http.post(`${API}channel/Channel/saveChannelByNav`, params)
  },
  // 获取频道信息
  getChannelInfo(params) {
    return $http.post(`${API}channel/Channel/getChannelById`, params)
  },
  // 删除频道
  delChannel(params) {
    return $http.post(`${API}channel/Channel/delChannelById`, params)
  },

  // 获取广告位列表
  getAdsList(params) {
    return $http.post(`${API}advertise/Advertise/getAdvertiseList`, params)
  },
  // 广告位 删除
  delAds(params) {
    return $http.post(`${API}advertise/Advertise/delAdvertise`, params)
  },
  // 获取 广告位 信息
  getAdsInfo(params) {
    return $http.post(`${API}advertise/Advertise/getAdvertiseInfo`, params)
  },
  // 广告位 新增/编辑
  addAds(params) {
    return $http.post(`${API}advertise/Advertise/saveAdvertise`, params)
  },

  // 获取 广告 列表
  getAdvertList(params) {
    return $http.post(`${API}advert/Advert/getAdvertList`, params)
  },
  // 广告 删除
  delAdvert(params) {
    return $http.post(`${API}advert/Advert/delAdvertById`, params)
  },
  // 获取 广告 信息
  getAdvertInfo(params) {
    return $http.post(`${API}advert/Advert/getAdvertById`, params)
  },
  // 广告 新增/编辑
  addAdvert(params) {
    return $http.post(`${API}advert/Advert/saveAdvert`, params)
  }
}

// 根据商品id列表，获取商品
export const apiGoodsByIDList = (params) => {
  return $http.post(`${API}goods/Goods/getGoodsList`, params)
}

// 楼层管理
export const apiFloorMange = {
  // 修改楼层显示状态
  changeStatus(params) {
    return $http.post(`${API}goodsfloor/Goodsfloor/changeStatus`, params)
  },
  /**
   * 
   * @param {*} 首页 
   */
  // 获取楼层列表
  queryHFloorList(params) {
    return $http.post(`${API}goodsfloor/Goodsfloor/getGoodsFloorList`, params)
  },
  // 添加/编辑 楼层
  addHFloor(params) {
    return $http.post(`${API}goodsfloor/Goodsfloor/saveGoodsFloor`, params)
  },
  // 删除 楼层
  delHFloor(params) {
    return $http.post(`${API}goodsfloor/Goodsfloor/delGoodsInfo`, params)
  },
  // 查询楼层信息
  getHFloorInfo(params) {
    return $http.post(`${API}goodsfloor/Goodsfloor/getGoodsFloorInfo`, params)
  },
  // 编辑楼层模板
  editHTemp(params) {
    return $http.post(`${API}goodsfloor/Goodsfloor/updateWideGoods`, params)
  },

  /**
   * 
   * @param {*} 频道 
   */
  // 获取楼层列表
  queryCFloorList(params) {
    return $http.post(`${API}channelfloor/ChannelFloor/getChannelFloorList`, params)
  },
  // 添加/编辑 楼层
  addCFloor(params) {
    return $http.post(`${API}channelfloor/ChannelFloor/saveChannelFloor`, params)
  },
  // 删除 楼层
  delCFloor(params) {
    return $http.post(`${API}channelfloor/ChannelFloor/delChannelFloor`, params)
  },
  // 查询楼层信息
  getCFloorInfo(params) {
    return $http.post(`${API}channelfloor/ChannelFloor/getChannelFloorInfo`, params)
  },
  // 编辑楼层模板
  editCTemp(params) {
    return $http.post(`${API}channelfloor/ChannelFloor/saveWideGoods`, params)
  },
  // 获取楼层模板
  getCTemp(params) {
    return $http.post(`${API}channelfloor/ChannelFloor/getWideGoods`, params)
  }
}

// 毛纱装修
export const apiWoolenMange = {
  // 根据导航获取频道
  getChannelByNav(params) {
    return $http.post(`${API}channel/Channel/listChannelByNav`, params)
  },
  // 根据导航新增频道-pc
  addChannelByNav(params) {
    return $http.post(`${API}channel/Channel/listChannelByNav`, params)
  },
  // 获取左侧分类
  getClassify(params) {
    return $http.post(`${API}classShow/Classshow/getViewClass`, params)
  },
  // 获取右侧授信额度
  getCreditList(params) {
    return $http.post(`${API}credit/Credit/listCredit`, params)
  },
  // 获取需求列表
  getDemanList(params) {
    return $http.post(`${API}demand/Demand/getLastestDemand`, params)
  },
  // 获取订单列表
  getOrderList(number) {
    return $http.post(`${API}matOrder/MatOrder/getMatOrderFirstPage`, { number })
  },
  // 获取毛纱列表项目名
  getListName() {
    return $http.post(`${API}searchType/SearchType/listType`)
  },
  // 获取商品列表 毛纱、成衣
  getGoodsList(params) {
    return $http.post(`${API}wideGoods/WideGoods/listGoods`, params)
  },
  // 根据id列表 获取商品
  searchIds(params) {
    return $http.post(`${API}worstGoods/WorstGoods/getGoodsByList`, params)
  },
  // 根据商品货号 获取商品
  searchGoodsNum(params) {
    return $http.post(`${API}worstGoods/WorstGoods/GoodsInfoByNumber`, params)
  }
}